function throwError() {
    throw "sub_error"
}

function catchSubError(){
    try {
            throwError()
    }catch (e) {
            print(e)
    }
}

catchSubError()